<template>
  <div class="count-sales">
    <div class="card">
      <div class="card__header">
        <span class="label">场站数量</span>
        <span class="value">{{ topInfo.terminalNum }}</span>
      </div>

      <div class="card__container">
        <ul class="count-sales__cop">
          <li>
            <span>运行中</span>

            <div class="fall">
              <!-- <i class="el-icon-bottom-right"></i> -->
              <!-- <span>-4%</span> -->
              <span>{{ topInfo.running }}</span>
            </div>

          </li>

          <li>
            <span>未启用</span>

            <div class="rise">
              <!-- <i class="el-icon-top-right"></i> -->
              <span>{{ topInfo.unrunning }}</span>
            </div>
          </li>
        </ul>
      </div>

      <div class="card__footer">
        <span class="label">启用比例</span>
        <span v-if="!isNaN((topInfo.running/topInfo.terminalNum).toFixed(2) * 100)" class="value">{{ (topInfo.running/topInfo.terminalNum).toFixed(2) * 100 }}%</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    topInfo: {
      type: Object,
      default: () => {}
    }
  }
}
</script>

<style lang="scss" scoped>
.count-sales {
	&__cop {
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 50px;

		li {
			display: flex;
			list-style: none;
			flex: 1;
			color: #d8d8d8;

			.fall,
			.rise {
				display: flex;
				align-items: center;
				margin-left: 10px;
			}

			.fall {
				color: #13ae7c;
			}

			.rise {
				color: #f21e37;
			}
		}
	}
}
</style>
